<%@ page import="java.util.ArrayList" %>
<%@ page import="com.jr.pojo.ProjectInfo" %><%--
  Created by IntelliJ IDEA.
  User: 12700
  Date: 2025/8/26
  Time: 15:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head>
    <title>$Title$</title>
<%--      <%
          String xy = request.getScheme();
          String ip = request.getServerName();
          int dk = request.getServerPort();
          String proname = request.getContextPath();
          String url=xy+"://"+ip+":"+dk+"/"+proname+"/";
      %>
      <base href="<%=url%>">--%>
  </head>
  <body>
  <form action="projectInfo/query" method="get">
      <b>申报状态</b>
      <select name="status">
          <option value="-1">全部</option>
          <option value="0">已申报</option>
          <option value="1">审核中</option>
          <option value="2">已审核</option>
      </select>
      <input type="submit" value="查询">
  </form>
  <%
      ArrayList<ProjectInfo> list = (ArrayList<ProjectInfo>)session.getAttribute("list");
  %>
  <table>
      <caption>
          申报列表项目
      </caption>
      <tr>
          <th>项目编号</th>
          <th>项目名称</th>
          <th>开始时间</th>
          <th>结束时间</th>
          <th>状态</th>
          <th>操作</th>
      </tr>
      <%for(ProjectInfo pro:list){%>
      <tr>
          <td><%=pro.getPid()%></td>
          <td><%=pro.getPname()%></td>
          <td><%=pro.getStartdate()%></td>
          <td><%=pro.getEnddate()%></td>
          <td><%=getProStatus(pro.getStatus())%></td>
          <td>
              <% if (pro.getStatus() == 0) {%>
              <a href="projectInfo/queryByPid?pid=<%=pro.getPid()%>">审核</a>
              <% }%>
          </td>
      </tr>
      <%}%>
      <tr>
          <td colspan="6">
              <% Object mess=session.getAttribute("mess");
                  if(mess!=null){
              %>
              <b style="color: red"><%=mess%></b>
              <%}%>

          </td>
      </tr>
      <%!
        public String getProStatus(int status){
            if(status==0){
                return "已申报";
            }else if(status==1){
                return "审核中";
            }else{
                return "已审核";
            }
        }
      %>

  </table>
  </body>
</html>
